package com.codervibe.web.common.exception;

import com.codervibe.web.common.response.ResultCodeEnum;
import lombok.Data;

@Data
public class controllerException extends RuntimeException{
    private Integer code;

    public controllerException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public controllerException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }

    @Override
    public String toString() {
        return "DemoException{" + "code=" + code + ", message=" + this.getMessage() + '}';
    }


}
